home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
pctchnqs
/
1991
/
number4
/
dircomp.c
< prev
next >
Wrap
Text File
|
1990-06-23
|
733b
|
28 lines
int dir_compare(char file_1[], char file_2[])
{
int result;
// compare extensions
result = strncmp(&file1[9],&file2[9],3);
// if they aren't equal return the result
if (result != 0)
return(result);
// extensions were equal so compare names
result = strncmp(&file1[0],&file2[0],8);
if (result != 0)
return(result);
// datecmp() is assumed to compare directory style dates
result = datecmp(&file1[23],&file2[23]);
if (result != 0)
return(result);
// timecmp() is assumed to compare directory style times
result = timecmp(&file1[33],&file2[33]);
// return whatever the result of timecmp() was
return(result);
}